summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-12-24 23:31:34 +0100
committerLiam <byteslice@airmail.cc>2022-12-24 23:31:34 +0100
commitcb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e (patch)
treeee30246618bba61a84a6ad0f7bf8784f8c8d6797
parentqt: fix 'Pause' menu item (#9497) (diff)
downloadyuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar.gz
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar.bz2
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar.lz
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar.xz
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.tar.zst
yuzu-cb7f0c2ec367ae8b480cf9ca7b1e3df6a4d0425e.zip
-rw-r--r--src/yuzu/main.cpp15
-rw-r--r--src/yuzu/main.h2
2 files changed, 12 insertions, 5 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 6121711e0..524650144 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1785,9 +1785,9 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
OnStartGame();
}
-void GMainWindow::OnShutdownBegin() {
+bool GMainWindow::OnShutdownBegin() {
if (!emulation_running) {
- return;
+ return false;
}
if (ui->action_Fullscreen->isChecked()) {
@@ -1799,6 +1799,10 @@ void GMainWindow::OnShutdownBegin() {
// Disable unlimited frame rate
Settings::values.use_speed_limit.SetValue(true);
+ if (system->IsShuttingDown()) {
+ return false;
+ }
+
system->SetShuttingDown(true);
discord_rpc->Pause();
@@ -1817,6 +1821,8 @@ void GMainWindow::OnShutdownBegin() {
ui->action_Pause->setEnabled(false);
ui->action_Restart->setEnabled(false);
ui->action_Stop->setEnabled(false);
+
+ return true;
}
void GMainWindow::OnShutdownBeginDialog() {
@@ -3003,8 +3009,9 @@ void GMainWindow::OnStopGame() {
return;
}
- OnShutdownBegin();
- OnShutdownBeginDialog();
+ if (OnShutdownBegin()) {
+ OnShutdownBeginDialog();
+ }
}
void GMainWindow::OnLoadComplete() {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 95220b063..db318485d 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -336,7 +336,7 @@ private slots:
void OnReinitializeKeys(ReinitializeKeyBehavior behavior);
void OnLanguageChanged(const QString& locale);
void OnMouseActivity();
- void OnShutdownBegin();
+ bool OnShutdownBegin();
void OnShutdownBeginDialog();
void OnEmulationStopped();
void OnEmulationStopTimeExpired();